package com.shigen.demo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shigen.demo.shorturl.entity.ShortLink;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author shigenfu
 * @date 2023/10/14 14:07
 */
public interface ShortLinkMapper extends BaseMapper<ShortLink> {

    /**
     * 根据code获得长链接
     *
     * @param code code
     * @return 长链接
     */
    @Select("select origin_url from short_link where short_code = #{code}")
    String getLink(@Param("code") String code);
}
